<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<%
call adminRight(0)

ArticleID=request("ArticleID")
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>编辑页面</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="./../kindeditor/kindeditor.js"></script>
</head>
<body>
<%
   sql="select * from information where id="&ArticleID
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open sql,conn,1,1
%>
   <form method="post" name="myform" action="Admin_information_Save.asp?action=Modify" onSubmit="return checkadd()">
    <div id="frame_Toolbar" class="toolbarBg"> 
		<a href="javascript:self.history.back();" class="icoBtn_ct"><span class="btnIco btnBack"></span>返回</a> 
		<a href="javascript:self.location.reload();" class="icoBtn_ct"><span class="btnIco btnReload"></span>刷新</a> 
		<span class="split ftSplit" ></span>
	<div id="guide" class="light_orange">请填写页面信息！</div>
	<div class="pageInfo right light_gray"></div>
    </div>
    <table class="cTable_2 table">
	<tr class="cTitle toolbarBg">
		<td colspan="2"><div class="cLeftPadding">编辑页面内容</div></td>
	</tr>
	<tr>
		<td class="tRight" width="15%">标题：</td>
		<td><input name="Title" type="text" style="width:300px;" value='<%=rs("Title")%>' maxlength="255" />
	    <span style="color:Red;">*</span></td>
	</tr>
	<tr style="display:none">
	  <td class="tRight">小图：</td>
	  <td><input name="pic" value="<%=rs("pic")%>" type="text" id="pic" style="width:300px;" maxlength="255" /><iframe src="Upload_form_lt.asp?n=pic&x=1" height="25" width="350" frameborder="0"></iframe></td>
	  </tr>
	<tr>
	  <td valign="top" class="tRight"></td>
	  <td><div style="width:650px; text-align:right; padding-top:8px"><span style="float:right"><iframe src="Upload_form_lt.asp?n=Content&x=2" height="25" width="320" frameborder="0"></iframe></span><span style="float:right; padding-top:4px">图片或文件快速上传：</span></div></td>
    </tr>
	<tr>
		<td valign="top" class="tRight">内容：</td>
		<td>
	    <script type="text/javascript">
		KE.show({
			id : 'Content',
			allowFileManager : true,
			afterCreate : function(id) {
				KE.blur(id);
			}
		});
	    </script>
		<div class="editor">
        <textarea id="Content" name="Content" style="width:650px;height:350px;visibility:hidden;"><%=replace(rs("Content"),"="&chr(34)&"./","="&chr(34)&"./../")%></textarea>
        </div>
		</td>
	</tr>
	<tr>
	  <td class="tRight">首页图片：</td>
	  <td> <input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="<%=rs("DefaultPicUrl")%>" style="width:300px" maxlength="255" readonly="0"> 
              <br>
              首页的图片,直接从上传图片中选择： 
              <select name="DefaultPicList" id="DefaultPicList" onChange="DefaultPicUrl.value=this.value;">
                <option value="images/nopic.gif" <% if rs("DefaultPicUrl")="images/nopic.gif" then response.write "selected" %>>不指定首页图片</option>
                <%
				if rs("UploadFiles")<>"" then
					dim IsOtherUrl
					IsOtherUrl=True
					if instr(rs("UploadFiles"),"|")>1 then
						dim arrUploadFiles,intTemp
						arrUploadFiles=split(rs("UploadFiles"),"|")						
						for intTemp=0 to ubound(arrUploadFiles)
							if rs("DefaultPicUrl")=arrUploadFiles(intTemp) then
								response.write "<option value='" & arrUploadFiles(intTemp) & "' selected>" & arrUploadFiles(intTemp) & "</option>"
								IsOtherUrl=False
							else
								response.write "<option value='" & arrUploadFiles(intTemp) & "'>" & arrUploadFiles(intTemp) & "</option>"
							end if
						next
					else
						if rs("UploadFiles")=rs("DefaultPicUrl") then
							response.write "<option value='" & rs("UploadFiles") & "' selected>" & rs("UploadFiles") & "</option>"
							IsOtherUrl=False
						else
							response.write "<option value='" & rs("UploadFiles") & "'>" & rs("UploadFiles") & "</option>"		
						end if
					end If
					if IsOtherUrl=True and rs("DefaultPicUrl")<>"images/nopic.gif" then
						response.write "<option value='" & rs("DefaultPicUrl") & "' selected>" & rs("DefaultPicUrl") & "</option>"
					end if
				end if
				 %>
              </select><input name="UploadFiles" type="hidden" id="UploadFiles" value="<%=rs("UploadFiles")%>">           </td>
	  </tr>
	<tr>
	  <td class="tRight">发布日期：</td>
	  <td><input name="AddDate" type="text" id="AddDate" value="<%=rs("AddDate")%>">
	    请保持原有格式</td>
	  </tr>
	<tr>
	  <td class="tRight">推荐：</td>
	  <td>
	      <input name="Show" type="checkbox" id="Show" value="True" <%if rs("Show")=True then response.Write("checked") end if%> />
		  <input name="ArticleID" type="hidden" id="ArticleID" value="<%=rs("ID")%>">
	    </td>
	  </tr>
    </table>
	<%
	   rs.close
	   set rs=nothing
	%>
    <div id="cEndToolbar" class="toolbarBg">
      <div class="caButCase">
		    <input type="submit" name="Submit" value="确认修改" class="button">
	        <input type="reset" name="Submit2" value="清空重填" class="button">
      </div>
    </div>
  </form>
</body>
</html>
<script language="javascript">
function AddItem(strFileName){
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}


function checkadd()
{
	if(document.myform.Title.value=="")
	{  
		alert("请填写标题!");  
		document.myform.Title.focus();  
		return (false);  
	}
}
</script>